package com.itheima.zhuanhuan;

import java.io.*;
import java.nio.charset.Charset;

/*
使用gbk 写一个文本文档
 */
public class Demo02 {


    public static void main(String[] args) throws IOException {
       //FileWriter writer = new FileWriter("day13\\aaa\\b.txt", Charset.forName("gbk"));
       // OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream("day13\\aaa\\b.txt"),"gbk");
      //  OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream("day13\\aaa\\b.txt"),Charset.forName("gbk"));
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("day13\\aaa\\b.txt"), Charset.forName("gbk")));
        writer.write("哈哈哈, 今天真是开心的一天");
        writer.close();

    }
}
